#pragma once

namespace tasksystem
{
	// Base Task
	class Task
	{
	public:
		enum State
		{
			Ready,
			Active,
			Done,
			Paused,
			Interrupted
		};

		Task();
		virtual ~Task();

		State getState() const;
		void start();
		void done();
		void interrupt();
		void update(float dt);
	protected:
		virtual void onStart();
		virtual void onUpdate(float dt);
		virtual void onDone();
		virtual void onPaused();
		virtual void onResumed();
		virtual void onInterrupted();
		virtual void onFinalize();

		State _state;
	};
}